﻿using Autofac;

namespace ShuttleBus
{
    internal class UnitOfWork
    {
        private static UnitOfWork _instance;

        private UnitOfWork()
        {
        }

        internal static UnitOfWork Instance
        {
            get { return _instance ?? (_instance = new UnitOfWork()); }
        }

        internal IContainer ApplicationContainer { get; set; }

        internal ILifetimeScope CreateUnitOfWorkContainer()
        {
            return ApplicationContainer.BeginLifetimeScope();
        }
    }
}